<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta charset="UTF-8"/>
    <link th:rel="stylesheet" th:href="@{/webjars/bootstrap/4.6.0-1/css/bootstrap.min.css} "/>
    <title>SMW</title>
</head>

<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark static-top">
    <div class="container">
        <a class="navbar-brand" href="/">Stock Market Watcher</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"
                aria-controls="navbarResponsive"
                aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarResponsive">
            <ul class="navbar-nav ml-auto">
                <li class="nav-item active">
                    <a class="nav-link" href="#">Register & Login
                        <span class="sr-only">(current)</span>
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">Contact</a>
                </li>
            </ul>
        </div>
    </div>
</nav>
<div class="container">
    <div class="row">
        <div class="col-md-6 col-md-offset-3">

            <!-- success message -->
            <div th:if="${param.success}">
                <div class="alert alert-info">You've successfully registered
                    to stock market watcher
                </div>
            </div>

            <h1>Registration</h1>

            <form th:action="@{/registration}" method="post" th:object="${user}">
                <div class="form-group">
                    <label class="control-label" for="firstName"> First Name </label>
                    <input id="firstName" class="form-control" th:field="*{firstName}"
                           required autofocus="autofocus"/>
                </div>

                <div class="form-group">
                    <label class="control-label" for="lastName"> Last Name </label> <input
                        id="lastName" class="form-control" th:field="*{lastName}"
                        required autofocus="autofocus"/>
                </div>

                <div class="form-group">
                    <label class="control-label" for="email"> Email </label> <input
                        id="email" class="form-control" th:field="*{email}" required
                        autofocus="autofocus"/>
                </div>

                <div class="form-group">
                    <label class="control-label" for="password"> Password </label> <input
                        id="password" class="form-control" type="password"
                        th:field="*{password}" required autofocus="autofocus"/>
                </div>

                <div class="form-group">
                    <button type="submit" class="btn btn-primary">Register</button>
                    <span>Already registered? <a href="/" th:href="@{/login}">Login
								here</a></span>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>